package com.anlu.pattern.action.mediator;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * <p>
 *
 * @author anlu
 * @date 2022/9/7 0007 0:22
 */
public class ChatRoom {
    private String name;

    public ChatRoom(String name) {
        this.name = name;
    }

    List<User>  users = new ArrayList<>();
    public void connect(User user){
        //用户进入聊天室列表
        this.users.add(user);
        System.out.println("欢迎:");
        System.out.println(user.getName());
        System.out.println(" ；加入了聊天室【"+this.name+"】");


    }

    public void sendMsg(User fromWhom, String msg){

    }
}
